//go:build wireinject
// +build wireinject

package wire

import (
	"GoProject/internal/handler"
	"GoProject/internal/repository"
	"GoProject/internal/server"
	"GoProject/internal/service"
	"GoProject/pkg/log"
	"GoProject/pkg/sid"
	"github.com/google/wire"
	"github.com/spf13/viper"
)

var HandlerSet = wire.NewSet(
	handler.NewHandler,
	handler.NewUserHandler,
)
var ServiceSet = wire.NewSet(
	service.NewService,
	service.NewUserService,
)
var RepositorySet = wire.NewSet(
	repository.NewDB,
	repository.NewRedis,
	repository.NewRepository,
	repository.NewUserRepository,
)

func NewApp(*viper.Viper, *log.Logger) (*server.Server, error) {
	panic(wire.Build(HandlerSet, ServiceSet, RepositorySet, sid.NewSid, server.NewServer))
}
